<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        /* 
        对象的增删改查
            增：添加一个属性进去  obj.xxx=xxx;

            删：delete obg.xxx;

            改：覆盖原有的属性
        */

        var obj = {
            name: "xiaowang",
            age: 18,
            //do也是obj的属性，只不过是一个特殊的属性，值是一个函数，我们可以叫他方法
            do: function() {

            }
        }
        //添加属性
        obj.csore = 100;
        console.log(obj)

        //删除属性
        delete obj.age;
        console.log(obj)

        //改
        obj.name = "laowan";
        console.log(obj)

        obj.csore = "20";
        console.log(obj)

        //查
        var re = obj.name;
        console.log(re)
    </script>
</body>
</html>